<template>
    <a-button type="primary" @click="export_data" :style="{marginRight:'2px'}">导出</a-button>
</template>

<script>
import {export2Excel} from "@/utils/excel/export_excel";

export default {
  name: "export_excel",
  setup(context, props) {
    const tHeader = [
      '鲜花',
      '颜色',
      '照片'
    ]
    const tbody = [
      {
        name: '玫瑰花',
        color: '红色',
        pic: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2801998497,4036145562&fm=27&gp=0.jpg'
      },
      {
        name: '菊花',
        color: '黄色',
        pic: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1506844670,1837003941&fm=200&gp=0.jpg'
      },
      {
        name: '牵牛花',
        color: '紫色',
        pic: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3056120770,1115785765&fm=27&gp=0.jpg'
      },
      {
        name: '梅花',
        color: '白色',
        pic: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2700343322,3431874915&fm=27&gp=0.jpg'
      },
      {
        name: '桃花花',
        color: '粉色',
        pic: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=602076004,4209938077&fm=27&gp=0.jpg'
      }
    ]
    const export_data = () => {
      export2Excel(tHeader, tbody, '我爱花朵')
    }
    return {
      export_data
    }

  }
}
</script>

<style scoped>

</style>
